<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2510：弱题</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">弱题</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">弱题</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                弱题                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="text-indent: 21pt"><span style="font-size: medium">有<i>M</i>个球，一开始每个球均有一个初始标号，标号范围为1～<i>N</i>且为整数，标号为<i>i</i>的球有<i>a<sub>i</sub></i>个，并<b>保证</b><b>&Sigma;</b><b><i>a<sub>i</sub></i></b><b> = <i>M</i></b>。</span></div>
<div style="text-indent: 21pt"><span style="font-size: medium">每次操作<b><u>等概率</u></b>取出一个球（即取出每个球的概率均为1/<i>M</i>），若这个球标号为<i>k</i>（<i>k</i> &lt; <i>N</i>），则将它重新标号为<i>k</i> + 1；若这个球标号为<i>N</i>，则将其重标号为1。<b>（取出球后并不将其丢弃）</b></span></div>
<div style="text-indent: 21pt"><span style="font-size: medium">现在你需要求出，经过<i>K</i>次这样的操作后，每个标号的球的期望个数。</span></div>
<div><span style="font-size: medium">&nbsp;</span></div>
<div style="text-indent: 21pt"></div></p><hr/><h3>输入格式</h3><p><div style="text-indent: 21pt"><span style="font-size: medium">第1行包含三个<b><u>正整数</u></b><i>N</i>，<i>M</i>，<i>K</i>，表示了标号与球的个数以及操作次数。</span></div>
<div style="text-indent: 21pt"><span style="font-size: medium">第2行包含<i>N</i>个<b><u>非负整数</u></b><i>a<sub>i</sub></i>，表示初始标号为<i>i</i>的球有<i>a<sub>i</sub></i>个。</span></div>
<div style="text-indent: 21pt"><span style="font-size: medium">&nbsp;</span></div>
<div style="text-indent: 21pt"></div></p><hr/><h3>输出格式</h3><p><div style="text-indent: 21pt"><span style="font-size: medium">应包含<i>N</i>行，第<i>i</i>行为标号为<i>i</i>的球的期望个数，四舍五入保留3位小数。</span></div>
<div><span style="font-size: medium">&nbsp;</span></div>
<div style="text-indent: 21pt"></div></p><hr/><h3>样例输入</h3><pre>2 3 2
3 0
 
</pre><hr/><h3>样例输出</h3><pre>1.667
1.333
 
</pre><hr/><h3>提示</h3><p><p>【样例说明】<br />
第1次操作后，由于标号为2球个数为0，所以必然是一个标号为1的球变为标号为2的球。所以有2个标号为1的球，有1个标号为2的球。<br />
第2次操作后，有1/3的概率标号为2的球变为标号为1的球（此时标号为1的球有3个），有2/3的概率标号为1的球变为标号为2的球（此时标号为1的球有1个），所以标号为1的球的期望个数为1/3*3+2/3*1 = 5/3。同理可求出标号为2的球期望个数为4/3。<br />
&nbsp;<br />
【数据规模与约定】<br />
对于10%的数据，N &le; 5, M &le; 5, K &le; 10；<br />
对于20%的数据，N &le; 20, M &le; 50, K &le; 20；<br />
对于30%的数据，N &le; 100, M &le; 100, K &le; 100；<br />
对于40%的数据，M &le; 1000, K &le; 1000；<br />
对于100%的数据，N &le; 1000, M &le; 100,000,000, K &le; 2,147,483,647。</p>
<p><br />
</p></p><hr/><h3>题目来源</h3><p>2011福建集训</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2510" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2510" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>